home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / chichi.swf / scripts / frame_235 / PlaceObject2_251_174 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2008-09-26  |  629 b   |  27 lines

  1. onClipEvent(enterFrame){
  2.    if(active)
  3.    {
  4.       xdif = targetx - _X;
  5.       _X = _X + xdif / 10;
  6.       ydif = targety - _Y;
  7.       _Y = _Y + ydif / 10;
  8.       if(Math.abs(xdif) < 0.2 && Math.abs(ydif) < 0.2)
  9.       {
  10.          _X = targetx;
  11.          _Y = targety;
  12.          active = false;
  13.       }
  14.       this.onMouseDown = function()
  15.       {
  16.          if(_global.die == false)
  17.          {
  18.             _parent.shot1._x = this._x;
  19.             _parent.shot1._y = this._y;
  20.             _parent.shot1.gotoAndPlay(2);
  21.             _parent.sht.gotoAndPlay(1);
  22.             _global.mojo -= 2;
  23.          }
  24.       };
  25.    }
  26. }
  27.